package com.lkd.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lkd.dto.PartnerDto;
import com.lkd.entity.Partner;
import com.lkd.mapper.PartnerMapper;
import com.lkd.service.IPartnerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lkd.vo.PageBean;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 合作商表 服务实现类
 * </p>
 *
 * @author zzy
 * @since 2025-10-10
 */
@Service
public class PartnerServiceImpl extends ServiceImpl<PartnerMapper, Partner> implements IPartnerService {

    @Autowired
    private PartnerMapper partnerMapper;

    @Override
    public PageBean<Partner> search(PartnerDto partnerDto) {
        //1.设置分页参数
        Page<Partner> page = new Page<>(partnerDto.getPageIndex(), partnerDto.getPageSize());
        //3.执行分页查询
        Page<Partner> search = partnerMapper.search(page,partnerDto);
        //4.构建返回结构
        return new PageBean<>(search);
    }
}
